#include "digital_tube.h"
unsigned char code DSY_CODE[]=
{
    0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0x82,0xf8,0x80,0x90,0xff
};
/**************************************************************************************
* FunctionName   : ShowNum()
* Description    : 多位数码管控制显示
* EntryParameter : num 显示的数字，tag 位号
* ReturnValue    : None
**************************************************************************************/
void ShowNum(unsigned char num,unsigned char tag)
{
    P0=0x00;
    if(num<10&&num>=0) P0=~DSY_CODE[num];

    P2=P2|0x0F;
    switch(tag)
    {
    case 0x01:
        P2=P2&0xFE;
        break;
    case 0x02:
        P2=P2&0xFD;
        break;
    case 0x03:
        P2=P2&0xFB;
        break;
    case 0x04:
        P2=P2&0xF7;
        break;
    }
}
